import request from '@/utils/request';

/** 导出surveySatisfactionPlan接口


  import  { postSurveySatisfactionPlanAdd,postUpdateExport,postGetResult,postMonth,postUpdate,getSurveySatisfactionPlan } from "@/api/surveySatisfactionPlan/index"


  */

/**
满意度计划新增
* @param { string } description - 调查描述 ( required: true )
* @param { string } endDate - 调查结束日期 ( required: true )
* @param { string } name - 任务名称 ( required: true )
* @param { array } responsible - 负责人 ( required: true )
* @param { string } startDate - 调查开始日期 ( required: true )
* @param { integer } templateId - 推送模板 ( required: true )
*/
export const postSurveySatisfactionPlanAdd = (data) => {
  return request({
    url: '/surveySatisfactionPlan/add',
    method: 'post',
    data: data,
  });
};

/**
计划导出
* @param { string } month - 指定月份 ( required: true )
* @param { string } name - 满意度计划名称 ( required: true )
*/
export const postUpdateExport = (data) => {
  return request({
    url: '/surveySatisfactionPlan/export',
    method: 'post',
    data: data,
  });
};

/**
分页获取满意度计划调研结果
* @param { integer } pageNum - 当前页码 ( required: true )
* @param { integer } pageSize - 显示条数 ( required: true )
* @param { integer } planId - 计划编号 ( required: true )
* @param { integer } rateRange - 满意度区间 surveyRateTypeEnum ( required: true )
* @param {  } submitTime - 提交时间 ( required: true )
* @param { string } userName - 调查内容 ( required: true )
*/
export const postGetResult = (data) => {
  return request({
    url: '/surveySatisfactionPlan/getResult',
    method: 'post',
    data: data,
  });
};

/**
获取指定月份满意度计划
* @param { string } month - 指定月份 ( required: true )
* @param { string } name - 满意度计划名称 ( required: true )
*/
export const postMonth = (data) => {
  return request({
    url: '/surveySatisfactionPlan/list/month',
    method: 'post',
    data: data,
  });
};

/**
满意度计划修改
* @param { string } description - 调查描述 ( required: true )
* @param { string } endDate - 调查结束日期 ( required: true )
* @param { integer } id - 主键id ( required: true )
* @param { string } name - 任务名称 ( required: true )
* @param { array } responsible - 负责人 ( required: true )
* @param { string } startDate - 调查开始日期 ( required: true )
* @param { integer } templateId - 推送模板 ( required: true )
*/
export const postUpdate = (data) => {
  return request({
    url: '/surveySatisfactionPlan/update',
    method: 'post',
    data: data,
  });
};

/**
满意度计划详情
* @param { integer } id - id ( required: true )
*/
export const getSurveySatisfactionPlan = (params) => {
  return request({
    url: `/surveySatisfactionPlan/${params.id}`,
    method: 'get',
    params: params,
  });
};
